﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Admx_Generator
{
    public class Policy
    {
        public enum PolicyClass
        {
            User,
            Machine,
            Both
        }

        public Policy(string name, PolicyClass policyClass, string displayName, string explainText, string presentation, string key, string valueName, Reference parentCategory, Reference supportedOn)
        {
            this.Name = name;
            this.Class = policyClass;
            this.DisplayName = String.IsNullOrEmpty(displayName) ? "$(string." + name + ")" : displayName;
            this.ExplainText = String.IsNullOrEmpty(explainText) ? String.Empty : explainText;
            this.Presentation = String.IsNullOrEmpty(presentation) ? String.Empty : presentation;
            this.Key = key;
            this.ValueName = String.IsNullOrEmpty(valueName) ? String.Empty : valueName;
            this.ParentCategory = parentCategory;
            this.SupportedOn = supportedOn;
        }

        /// <summary>
        /// Gets or Sets the name of this Policy
        /// </summary>
        public string Name { get; private set; }

        /// <summary>
        /// Gets or Sets the id used to retrieve the display name in the Adml files.
        /// </summary>
        public string DisplayName { get; private set; }

        /// <summary>
        /// Gets or Sets the id used to retrieve the explain text in the Adml file. String.Empty if not define.
        /// </summary>
        public string ExplainText { get; private set; }

        /// <summary>
        /// Gets or Sets the Class of this Policy
        /// </summary>
        public PolicyClass Class { get; private set; }

        /// <summary>
        /// Gets or Sets the Presentation for this Policy. String.Empty if not define.
        /// </summary>
        public string Presentation { get; private set; }

        /// <summary>
        /// Gets or Sets the Key for this Policy
        /// </summary>
        public string Key { get; private set; }

        /// <summary>
        /// Gets or Sets the ValueName for this Policy. String.Empty if not define.
        /// </summary>
        public string ValueName { get; private set; }

        /// <summary>
        /// Gets or Sets the Parent Category of this Policy. Null if not define.
        /// </summary>
        public Reference ParentCategory { get; private set; }

        /// <summary>
        /// Gets or Sets the reference to the SupportedOn of this Policy. Null if not define.
        /// </summary>
        public Reference SupportedOn { get; private set; }
    }
}
